<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>18、表单属性指令-v-model-select元素.html</title>
</head>
<body>

<div id="app">
    <h3>单选选择框</h3>

    <select id="education" onchange="changeEducation(this)">
        <option value="">--请选择学历--</option>
        <option value="1">小学</option>
        <option value="2">初中</option>
        <option value="3">高中</option>
        <option value="4">本科</option>
        <option value="5">硕士</option>
        <option value="6">博士</option>
    </select>


    <select v-model="education">
        <option value="">---请选择学历---</option>
        <option v-for="(option,index) in options" v-bind:value="option">{{option.atxt}}</option>
    </select>
    <p>你获取的学历是：{{education.aval}} == {{education.atxt}}</p>
</div>

<script src="js/vue.global.js"></script>
<script>




    var vm = Vue.createApp({
        created() {
        },
        data() {
            return {
                education: "",
                options:[
                    {aval:1,atxt:"小学"},
                    {aval:2,atxt:"初中"},
                    {aval:3,atxt:"高中"},
                    {aval:4,atxt:"本科"},
                    {aval:5,atxt:"硕士"},
                    {aval:6,atxt:"博士"}
                ]
            }
        },
        methods: {

        }


    }).mount("#app");
</script>

</body>
</html>